Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup redundant NeitherNull methods #65807

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

Youssef1313
Copy link
Member

It seems like callers of NeitherNull are passing SyntaxToken (which is a struct (value type)).

When those SyntaxTokens are boxed and compared against null, I think the comparison is always false. This PR cleans that up.

@Youssef1313 Youssef1313 requested a review from a team as a code owner December 6, 2022 16:38
@ghost ghost added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Dec 6, 2022
@@ -388,24 +388,18 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
End Function

Private Shared Function EqualIdentifierName(x As SyntaxToken, y As SyntaxToken, ByRef comparisonResult As Integer) As Boolean
If NeitherNull(x, y, comparisonResult) Then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NeitherNull isn't deleted in here because the arguments in the remaining usage is a reference type.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) December 6, 2022 16:39
@CyrusNajmabadi CyrusNajmabadi merged commit becd261 into dotnet:main Dec 6, 2022
@ghost ghost added this to the Next milestone Dec 6, 2022
@Youssef1313 Youssef1313 deleted the NeitherNull branch December 6, 2022 18:17
@Cosifne Cosifne modified the milestones: Next, 17.5 P3 Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants